package com.example.administrator.activityandintent1;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import org.w3c.dom.Text;

public class answerActivity1 extends AppCompatActivity {
    private Intent intent;
    private Bundle bunde;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_answer1);

        Bundle bundle = this.getIntent().getExtras();
        String ans = bundle.getString("ans");

        String sexText="";
        if (ans.equals("in"))
        {
            sexText="Right!";
        }
        else{
            sexText = "False!";
        }
        TextView tv1 = (TextView)findViewById(R.id.text1);
        tv1.setText("What you choise is " + sexText);

        Button btn3_back = (Button)findViewById(R.id.button_back);
        btn3_back.setOnClickListener(new Button.OnClickListener() {
            @Override
            public void onClick(View v) {
                answerActivity1.this.setResult(RESULT_OK,intent);
                answerActivity1.this.finish();
            }
        });
    }
}
